package com.whpost.admin.controller.stamp.h5;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/h5/wjy")
public class WjyController {

//    @RequestMapping(value="/bg")
//    public String bg(Model model, HttpServletRequest httpServletRequest) {
//        return "stamp/h5/wjy/bg";
//    }
//
//    @RequestMapping(value="/hhl12")
//    public String hhl12(Model model, HttpServletRequest httpServletRequest) {
//        return "stamp/h5/wjy/hhl12";
//    }
//
//    @RequestMapping(value="/hbdx")
//    public String hbdx(Model model, HttpServletRequest httpServletRequest) {
//        return "stamp/h5/wjy/hbdx";
//    }


    @RequestMapping(value = "/{variable}")
    public String handleRequest(@PathVariable String variable, Model model) {

        System.out.println("这里获取的variable:"+variable);
        if ("hhl12".equals(variable)) variable="1";
        if ("hbdx".equals(variable)) variable="4";
        if ("bg".equals(variable)) variable="5";
        System.out.println("转换后:"+variable);
        // 这里的variable就是URL中对应的部分
        model.addAttribute("sp", variable);
        return "stamp/h5/wjy/yp";
    }
}
